<ui:composition template="user_page_template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="content">
		<h4>Daily plans</h4>
		<h:form id="select">
			<h:commandLink id="newPlanButton" action="#{dailyPlanBean.create}"
				immediate="true" value="Create new daily plan..." />
			<h:panelGrid>
				<h:dataTable value="#{dailyPlanBean.plans}" var="plan">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Id" />
						</f:facet>
						<h:outputText value="#{plan.id}" />
					</h:column>

					<h:column>
						<f:facet name="header">
							<h:outputText value="username" />
						</f:facet>
						<h:outputText value="#{plan.username}" />
					</h:column>

					<h:column>
						<f:facet name="header">
							<h:outputText value="Date" />
						</f:facet>
						<h:outputText value="#{plan.date}" />
					</h:column>

					<h:column>
						<f:facet name="header">
							<h:outputText value="Activity" />
						</f:facet>
						<h:outputText value="#{plan.activity.label}" />
					</h:column>

					<h:column>
						<f:facet name="header">
							<h:outputText value="Estimate Duration" />
						</f:facet>
						<h:outputText value="#{plan.estimateDuration}" />
					</h:column>

					<h:column>
						<f:facet name="header">
							<h:outputText value="Actual Duration" />
						</f:facet>
						<h:outputText value="#{plan.actualDuration}" />
					</h:column>

					<h:column>
						<f:facet name="header">
							<h:outputText value="Comments" />
						</f:facet>
						<h:outputText value="#{plan.comments}" />
					</h:column>

					<h:column>
						<f:facet name="header">
							<h:outputText value="Action" />
						</f:facet>
						<h:panelGrid columns="2">
							<h:commandLink value="update"
								action="#{dailyPlanBean.update(plan.id)}" />
							<h:commandLink value="remove"
								action="#{dailyPlanBean.remove(plan.id)}" />
						</h:panelGrid>
					</h:column>
				</h:dataTable>
			</h:panelGrid>
		</h:form>

	</ui:define>

</ui:composition>